package com.hzlj.position.locate.common.enums;

import com.fz.common.base.exception.PubError;
import com.fz.common.base.exception.PubException;
import lombok.Getter;

/**
 * @author lifh
 * @date 2021/11/9 上午11:59
 **/
@Getter
public enum AbnMissingCheck {
    /**
     * 检测状态
     * 未检测:次日8点前状态
     * 检测中:次日8点-8点30分
     * 检测结束:超过次日8点30分状态
     */
    WAIT("0", "未检测"),
    ING("1", "检测中"),
    MISSING("2", "疑似失联"),
    NOT_MISSING("3", "未失联"),
    ;

    private final String status;
    private final String statusText;

    AbnMissingCheck(String status, String statusText) {
        this.status = status;
        this.statusText = statusText;
    }

    public static AbnMissingCheck of(String status) {
        for (AbnMissingCheck statusEnum : values()) {
            if (statusEnum.status.equalsIgnoreCase(status)) {
                return statusEnum;
            }
        }
        throw new PubException(PubError.PARAM_EMPTY_ERROR);
    }
}
